﻿package org.openChart.display.chart 
{
	import org.openChart.display.DisplayElement;
	import org.openChart.display.DisplayGroup;
	import org.openChart.display.DisplayBaseObject;
	import org.openChart.meta.data.DataElement;
	
	/**
	 * ...
	 * @author Chongyuan
	 */
	public class DisplayElementFactor 
	{
		
		public function DisplayElementFactor() 
		{
			
		}
		
		public static function create(element:DataElement, parent:DisplayGroup, chartType:String):DisplayElement
		{
			if (chartType.indexOf("pie") > 0)
			{
				return new DisplayPieElement(element, parent);
			}
			else
			{
				return new DisplayBarElement(element, parent);
			}
		}
		
	}
	
}